<template>
  <div>
    <com-title></com-title>
    <transition name="common" mode="out-in">
      <router-view :isLogin="isLogin" :username="username" @tocommon="logout"></router-view>
    </transition>
    <myfooter></myfooter>
  </div>
</template>
<script>
  import commonTitle from "@/components/eng-corner/ec-title"
  import footer from "@/components/footer"
    export default{
        components:{
          'myfooter':footer,
          "com-title":commonTitle
        },
        data:function(){
          return {
            isLogin:0,
            username:''
          }
        },
      methods:{
        logout:function(){
          this.isLogin=0;
          this.username="";
          this.getUserInfo();
        },
        getUserInfo:function(){
          let isLogin=this.$route.query.isLogin;
          let username=this.$route.query.username;
          let that=this;
          let timer=null;
          if(isLogin){
            this.isLogin=isLogin;
            this.username=username;
          }else{
            this.isLogin=0;
            this.username="";
          }
          this.$router.push({path:'/common/home?title=主页'});

        }
      },
      mounted:function(){
        this.getUserInfo();
      }
    }
</script>
<style scoped>

  .search-enter-active,.search-leave-active{
    transition: all .5s;
  }
  .search-enter,.search-leave-active{
    opacity: 0;
  }
  .common-enter-active,.common-leave-active{
    opacity: 1;
    transition: opacity .3s linear
  }
  .common-enter,.common-leave{
    opacity: 0;
  }


</style>
